package util;

import java.util.List;

public class PageModel {
    private int pageNo;//当前页数
    private int pageSize=6;//每页条数
    private int recordCount;//总记录数
    private int totalPages;//总页数
    private List<?> recordList;//当前页的记录
    private String likeValue;//查询条件

    public PageModel() {
    }

    public PageModel(int pageNo, int pageSize, int recordCount, int totalPages, List<?> recordList, String likeValue) {
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.recordCount = recordCount;
        this.totalPages = totalPages;
        this.recordList = recordList;
        this.likeValue = likeValue;
    }

    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getRecordCount() {
        return recordCount;
    }

    public void setRecordCount(int recordCount) {
        this.recordCount = recordCount;
    }

    public int getTotalPages() {
        int count=0;
        if (this.recordCount%this.pageSize!=0)
            count=1;
        return (this.recordCount/this.pageSize)+count;
        //return(this.recordCount%this.pageSize==0)?(this.recordCount/this.pageSize):(this.recordCount/this.pageSize)+1;
    }

    public void setTotalPages(int totalPages) {
        this.totalPages = totalPages;
    }

    public List<?> getRecordList() {
        return recordList;
    }

    public void setRecordList(List<?> recordList) {
        this.recordList = recordList;
    }

    public String getLikeValue() {
        return likeValue;
    }

    public void setLikeValue(String likeValue) {
        this.likeValue = likeValue;
    }
}
